
<?php
  header('content-type:text/html;charset=utf-8');
  include '../base.php';
	$id=$_POST['id'];
	$name=$_POST['name'];
	$pwd=$_POST['password'];
	$class=$_POST['class'];
	$sex=$_POST['sex'];
	$phone_num=$_POST['phone_num'];
	$major=$_POST['major'];
	$face=$_POST['face'];

	$port=array('status'=>'0','msg'=>'error','data'=>'');
	$update_sql = "UPDATE user as a INNER JOIN fac_value as b ON a.id=b.user_id SET a.password = '$pwd', a.class = '$class',  a.sex = '$sex', a.phone_num = '$phone_num', a.major = '$major',b.face = '$face'  WHERE a.id = '$id';";
	$result_update=mysqli_query($conn, $update_sql);
	if($result_update){

		$port['msg']='用户信息修改成功';
		$port['status']='1';
		$port['data']='用户信息修改成功';
		echo json_encode($port);
		exit;
	}else {
		$port['data']='用户信息修改失败';
		echo json_encode($port);
	 	exit;
	}
	mysqli_close($conn);
?>